-
Notifications
You must be signed in to change notification settings - Fork 949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: data race in pkg cri/stream #1925
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1925 +/- ##
==========================================
+ Coverage 63.74% 63.75% +0.01%
==========================================
Files 200 200
Lines 15527 15527
==========================================
+ Hits 9898 9900 +2
+ Misses 4396 4394 -2
Partials 1233 1233
|
cri/stream/portforward/httpstream.go
Outdated
p.printError(msg) | ||
case <-p.complete: | ||
logrus.Infof("(conn=%v, request=%s) successfully received error and data streams", h.conn, p.requestID) | ||
logrus.Infof("(conn=%p, request=%s) successfully received error and data streams", h.conn, p.requestID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we update it with address of connection? I don't think the %p
can provide useful information here.
cri/stream/portforward/httpstream.go
Outdated
|
||
if err != nil { | ||
msg := fmt.Sprintf("error forwarding port %d to pod %s: %v", port, h.pod, err) | ||
msg := fmt.Sprintf("PortForward of CRI: error forwarding port %d to pod %s: %v", port, h.pod, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer to use lowercase in the message.
7882693
to
5a522fa
Compare
Signed-off-by: YaoZengzeng <[email protected]>
5a522fa
to
1e1f3f2
Compare
@fuweid Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: YaoZengzeng [email protected]
Ⅰ. Describe what this PR did
There is an data race in pkg
cri/stream
when I build pouchd with flag-race
and use cri-tools to test the stream server related api:%v
will read the underlying structure which is the source of the data racewe should use the
%p
to avoid it.Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews